<?php  echo $form->create('Persona', array('action' => 'search')); ?>

<fieldset>
<legend><?php __('Busqueda de Personas'); ?></legend>
<table cellpadding="0" cellspacing="0">
    <tr>
        <th colspan="3"><?php echo $form->input('Search.identificacion',array('label'=>'Rut o Pasaporte')); ?></th>
    </tr>
    <tr>
        <td><?php echo $form->input('Search.paterno', array('label'=>'Apellido Paterno')); ?></td>
        <td><?php echo $form->input('Search.materno', array('label'=>'Apellido Materno')); ?></td>
        <td><?php echo $form->input('Search.nombres', array('label'=>'Nombres')); ?></td>
    </tr>
    <tr>
        <td colspan="3"><?php echo $form->submit(' Buscar '); ?></td>
    </tr>
</table>
</fieldset>

<?php  echo $form->end(); ?>



<div class="personas index">
    <br/>
<p>
<?php
echo $paginator->counter(array('format' => __('Pagina %page% de %pages%, mostrando %current% registros de un total de %count%, iniciando con %start%, y terminando con %end%', true)));
?>
</p>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort('Id', 'id');?></th>
	<th><?php echo $paginator->sort('Rut o Pasaporte','identificacion');?></th>
	<th><?php echo $paginator->sort('Ap. Paterno','paterno');?></th>
	<th><?php echo $paginator->sort('Ap. Materno','materno');?></th>
	<th><?php echo $paginator->sort('Nombres','nombres');?></th>
	<th><?php echo $paginator->sort('Fecha de Nacimiento','fecha_nacimiento');?></th>
	<th class="actions"><?php __('Acciones');?></th>
</tr>
<?php
$i = 0;
foreach ($personas as $persona):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $persona['Persona']['id']; ?>
		</td>
		<td>
			<?php echo $html->link(__($persona['Persona']['identificacion'], true), array('action'=>'view', $persona['Persona']['id'])); ?>
		</td>
		<td>
			<?php echo $persona['Persona']['paterno']; ?>
		</td>
		<td>
			<?php echo $persona['Persona']['materno']; ?>
		</td>
		<td>
			<?php echo $persona['Persona']['nombres']; ?>
		</td>
		<td>
			<?php echo $persona['Persona']['fecha_nacimiento']; ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('Actualizar', true), array('action'=>'edit', $persona['Persona']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('anterior', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('próximo', true).' >>', array(), null, array('class'=>'disabled'));?>
</div>

